home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / PictUtils.p < prev    next >
Text File  |  1996-05-01  |  8KB  |  233 lines

  1. {
  2.      File:        PictUtils.p
  3.  
  4.      Contains:    Picture Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT PictUtils;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __PICTUTILS__}
  28. {$SETC __PICTUTILS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC PictUtilsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __WINDOWS__}
  38. {$I Windows.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __PALETTES__}
  41. {$I Palettes.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  49. {  verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls  }
  50.  
  51. CONST
  52.     returnColorTable            = $0001;
  53.     returnPalette                = $0002;
  54.     recordComments                = $0004;
  55.     recordFontInfo                = $0008;
  56.     suppressBlackAndWhite        = $0010;
  57.  
  58.                                                                 {  color pick methods  }
  59.     systemMethod                = 0;                            {  system color pick method  }
  60.     popularMethod                = 1;                            {  method that chooses the most popular set of colors  }
  61.     medianMethod                = 2;                            {  method that chooses a good average mix of colors  }
  62.                                                                 {  color bank types  }
  63.     ColorBankIsCustom            = -1;
  64.     ColorBankIsExactAnd555        = 0;
  65.     ColorBankIs555                = 1;
  66.  
  67.  
  68. TYPE
  69.     PictInfoID                            = LONGINT;
  70.     CommentSpecPtr = ^CommentSpec;
  71.     CommentSpec = RECORD
  72.         count:                    INTEGER;                                {  number of occurrances of this comment ID  }
  73.         ID:                        INTEGER;                                {  ID for the comment in the picture  }
  74.     END;
  75.  
  76.     CommentSpecHandle                    = ^CommentSpecPtr;
  77.     FontSpecPtr = ^FontSpec;
  78.     FontSpec = RECORD
  79.         pictFontID:                INTEGER;                                {  ID of the font in the picture  }
  80.         sysFontID:                INTEGER;                                {  ID of the same font in the current system file  }
  81.         size:                    ARRAY [0..3] OF LONGINT;                {  bit array of all the sizes found (1..127) (bit 0 means > 127)  }
  82.         style:                    INTEGER;                                {  combined style of all occurrances of the font  }
  83.         nameOffset:                LONGINT;                                {  offset into the fontNamesHdl handle for the font's name  }
  84.     END;
  85.  
  86.     FontSpecHandle                        = ^FontSpecPtr;
  87.     PictInfoPtr = ^PictInfo;
  88.     PictInfo = RECORD
  89.         version:                INTEGER;                                {  this is always zero, for now  }
  90.         uniqueColors:            LONGINT;                                {  the number of actual colors in the picture(s)/pixmap(s)  }
  91.         thePalette:                PaletteHandle;                            {  handle to the palette information  }
  92.         theColorTable:            CTabHandle;                                {  handle to the color table  }
  93.         hRes:                    Fixed;                                    {  maximum horizontal resolution for all the pixmaps  }
  94.         vRes:                    Fixed;                                    {  maximum vertical resolution for all the pixmaps  }
  95.         depth:                    INTEGER;                                {  maximum depth for all the pixmaps (in the picture)  }
  96.         sourceRect:                Rect;                                    {  the picture frame rectangle (this contains the entire picture)  }
  97.         textCount:                LONGINT;                                {  total number of text strings in the picture  }
  98.         lineCount:                LONGINT;                                {  total number of lines in the picture  }
  99.         rectCount:                LONGINT;                                {  total number of rectangles in the picture  }
  100.         rRectCount:                LONGINT;                                {  total number of round rectangles in the picture  }
  101.         ovalCount:                LONGINT;                                {  total number of ovals in the picture  }
  102.         arcCount:                LONGINT;                                {  total number of arcs in the picture  }
  103.         polyCount:                LONGINT;                                {  total number of polygons in the picture  }
  104.         regionCount:            LONGINT;                                {  total number of regions in the picture  }
  105.         bitMapCount:            LONGINT;                                {  total number of bitmaps in the picture  }
  106.         pixMapCount:            LONGINT;                                {  total number of pixmaps in the picture  }
  107.         commentCount:            LONGINT;                                {  total number of comments in the picture  }
  108.         uniqueComments:            LONGINT;                                {  the number of unique comments in the picture  }
  109.         commentHandle:            CommentSpecHandle;                        {  handle to all the comment information  }
  110.         uniqueFonts:            LONGINT;                                {  the number of unique fonts in the picture  }
  111.         fontHandle:                FontSpecHandle;                            {  handle to the FontSpec information  }
  112.         fontNamesHandle:        Handle;                                    {  handle to the font names  }
  113.         reserved1:                LONGINT;
  114.         reserved2:                LONGINT;
  115.     END;
  116.  
  117.     PictInfoHandle                        = ^PictInfoPtr;
  118.     InitPickMethodProcPtr = ProcPtr;  { FUNCTION InitPickMethod(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16): OSErr; }
  119.  
  120.     InitPickMethodUPP = UniversalProcPtr;
  121.  
  122. CONST
  123.     uppInitPickMethodProcInfo = $00000FA0;
  124.  
  125. FUNCTION NewInitPickMethodProc(userRoutine: InitPickMethodProcPtr): InitPickMethodUPP;
  126.     {$IFC NOT GENERATINGCFM }
  127.     INLINE $2E9F;
  128.     {$ENDC}
  129.  
  130. FUNCTION CallInitPickMethodProc(colorsRequested: SInt16; VAR dataRef: UInt32; VAR colorBankType: SInt16; userRoutine: InitPickMethodUPP): OSErr;
  131.     {$IFC NOT GENERATINGCFM}
  132.     INLINE $205F, $4E90;
  133.     {$ENDC}
  134.  
  135. TYPE
  136.     RecordColorsProcPtr = ProcPtr;  { FUNCTION RecordColors(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32): OSErr; }
  137.  
  138.     RecordColorsUPP = UniversalProcPtr;
  139.  
  140. CONST
  141.     uppRecordColorsProcInfo = $00003FE0;
  142.  
  143. FUNCTION NewRecordColorsProc(userRoutine: RecordColorsProcPtr): RecordColorsUPP;
  144.     {$IFC NOT GENERATINGCFM }
  145.     INLINE $2E9F;
  146.     {$ENDC}
  147.  
  148. FUNCTION CallRecordColorsProc(dataRef: UInt32; VAR colorsArray: RGBColor; colorCount: SInt32; VAR uniqueColors: SInt32; userRoutine: RecordColorsUPP): OSErr;
  149.     {$IFC NOT GENERATINGCFM}
  150.     INLINE $205F, $4E90;
  151.     {$ENDC}
  152.  
  153. TYPE
  154.     CalcColorTableProcPtr = ProcPtr;  { FUNCTION CalcColorTable(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray): OSErr; }
  155.  
  156.     CalcColorTableUPP = UniversalProcPtr;
  157.  
  158. CONST
  159.     uppCalcColorTableProcInfo = $00003EE0;
  160.  
  161. FUNCTION NewCalcColorTableProc(userRoutine: CalcColorTableProcPtr): CalcColorTableUPP;
  162.     {$IFC NOT GENERATINGCFM }
  163.     INLINE $2E9F;
  164.     {$ENDC}
  165.  
  166. FUNCTION CallCalcColorTableProc(dataRef: UInt32; colorsRequested: SInt16; colorBankPtr: UNIV Ptr; VAR resultPtr: CSpecArray; userRoutine: CalcColorTableUPP): OSErr;
  167.     {$IFC NOT GENERATINGCFM}
  168.     INLINE $205F, $4E90;
  169.     {$ENDC}
  170.  
  171. TYPE
  172.     DisposeColorPickMethodProcPtr = ProcPtr;  { FUNCTION DisposeColorPickMethod(dataRef: UInt32): OSErr; }
  173.  
  174.     DisposeColorPickMethodUPP = UniversalProcPtr;
  175.  
  176. CONST
  177.     uppDisposeColorPickMethodProcInfo = $000000E0;
  178.  
  179. FUNCTION NewDisposeColorPickMethodProc(userRoutine: DisposeColorPickMethodProcPtr): DisposeColorPickMethodUPP;
  180.     {$IFC NOT GENERATINGCFM }
  181.     INLINE $2E9F;
  182.     {$ENDC}
  183.  
  184. FUNCTION CallDisposeColorPickMethodProc(dataRef: UInt32; userRoutine: DisposeColorPickMethodUPP): OSErr;
  185.     {$IFC NOT GENERATINGCFM}
  186.     INLINE $205F, $4E90;
  187.     {$ENDC}
  188. FUNCTION GetPictInfo(thePictHandle: PicHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  189.     {$IFC NOT GENERATINGCFM}
  190.     INLINE $303C, $0800, $A831;
  191.     {$ENDC}
  192. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle; VAR thePictInfo: PictInfo; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  193.     {$IFC NOT GENERATINGCFM}
  194.     INLINE $303C, $0801, $A831;
  195.     {$ENDC}
  196. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID; verb: INTEGER; colorsRequested: INTEGER; colorPickMethod: INTEGER; version: INTEGER): OSErr;
  197.     {$IFC NOT GENERATINGCFM}
  198.     INLINE $303C, $0602, $A831;
  199.     {$ENDC}
  200. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID; thePictHandle: PicHandle): OSErr;
  201.     {$IFC NOT GENERATINGCFM}
  202.     INLINE $303C, $0403, $A831;
  203.     {$ENDC}
  204. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID; thePixMapHandle: PixMapHandle): OSErr;
  205.     {$IFC NOT GENERATINGCFM}
  206.     INLINE $303C, $0404, $A831;
  207.     {$ENDC}
  208. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID; VAR thePictInfo: PictInfo; colorsRequested: INTEGER): OSErr;
  209.     {$IFC NOT GENERATINGCFM}
  210.     INLINE $303C, $0505, $A831;
  211.     {$ENDC}
  212. FUNCTION DisposePictInfo(thePictInfoID: PictInfoID): OSErr;
  213.     {$IFC NOT GENERATINGCFM}
  214.     INLINE $303C, $0206, $A831;
  215.     {$ENDC}
  216. {$IFC OLDROUTINENAMES }
  217. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  218.     {$IFC NOT GENERATINGCFM}
  219.     INLINE $303C, $0206, $A831;
  220.     {$ENDC}
  221. {$ENDC}
  222. {$ENDC}
  223. {$ALIGN RESET}
  224. {$POP}
  225.  
  226. {$SETC UsingIncludes := PictUtilsIncludes}
  227.  
  228. {$ENDC} {__PICTUTILS__}
  229.  
  230. {$IFC NOT UsingIncludes}
  231.  END.
  232. {$ENDC}
  233.